package com.ssd.service.impl;

import com.ssd.entity.CouponWriteOff;
import com.ssd.mapper.CouponWriteOffMapper;
import com.ssd.service.ICouponWriteOffService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 优惠券核销表 服务实现类
 * </p>
 *
 * @author author
 * @since 2024-11-21
 */
@Service
public class CouponWriteOffServiceImpl extends ServiceImpl<CouponWriteOffMapper, CouponWriteOff> implements ICouponWriteOffService {

    @Override
    public Integer getActivityCouponCount(Long id) {
        Integer count = lambdaQuery()
                .eq(CouponWriteOff::getActivityId, id)
                .count();
        return count;
    }
}
